package com.example.myblog01.service;

import com.example.myblog01.pojo.Blog;
import com.example.myblog01.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    Blog getBlog(Long id);

    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

//    查询返回前端主页数据
    Page<Blog> listBlog(Pageable pageable);


//    查询通过tagid
    Page<Blog> listBlog(Long tagId,Pageable pageable);

    Page<Blog> listBlog(String query,Pageable pageable);

    Blog seveblog(Blog blog);

    Blog updateBlog(Long id,Blog blog);

    void deleteBlog(Long id);

//    返回推荐的博客列表
    List<Blog> listRecommendBlogTop(Integer size);

//    返回编辑过Markdown的文本
    Blog getAndConvert(Long id);

//    根据年份查询所有Blog
    Map<String,List<Blog>> archiveBlog();


    Long countBlog();

}
